import request from '@/utils/request'

// 查询容器列表
export function listContainer(query) {
  return request({
    url: '/api/container/page',
    method: 'get',
    params: query
  })
}

// 查询容器详细
export function getContainer(containerId) {
  return request({
    url: '/api/container/' + containerId,
    method: 'get'
  })
}

// 新增容器
export function addContainer(data) {
  return request({
    url: '/api/container/add',
    method: 'post',
    data: data
  })
}

// 修改容器
export function updateContainer(data) {
  return request({
    url: '/api/container/update',
    method: 'post',
    data: data
  })
}

// 删除容器
export function delContainer(containerId) {
  return request({
    url: '/api/container/delete/' + containerId,
    method: 'post'
  })
}

// 导入
export function importContainerAPI(data) {
  return request({
    url: '/api/container/import',
    method: 'post',
    data
  })
}

// 修改容器状态
export function updateStatusAPI(data) {
  return request({
    url: '/api/container/updateStatus',
    method: 'post',
    data
  })
}

// 查询容器类型ID和名称
export function getContainerTypeAPI(query) {
  return request({
    url: '/api/containerType/idAndName',
    method: 'get',
    query
  })
}

export function batchAddAPI(data) {
  return request({
    url: '/api/container/batchAdd ',
    method: 'post',
    data
  })
}
